Chris Pollett > Old Classes >
CS158a

( Print View )

Student Corner:
  [Grades Sec1]

  [Submit Sec1]

  [Class Sign Up Sec1]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW/Quiz Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Quizzes]

Practice Exams:
  [Mid]  [Final]

                           












HW#5 --- last modified February 17 2019 19:25:46..

Solution set.

Due date: May 16

Files to be submitted:
  Hw5.zip

Purpose:To learn about the transport layer, socket programming, and a little about network security.

Related Course Outcomes:

The main course outcomes covered by this assignment are:

LO8 -- Understand TCP and UDP, and develop software for servers and clients of socket programming, and use them to measure the performance (including throughput and bandwidth) of real networks.

LO10 -- Understand concepts of data compression, network security and protocols.

Specification:

First, do the following problems out of the book: Ch 5: 2, 7, 20, 30, 44. Ch. 9: 14. Submit these (if you do a network experiment submit a transcript as well) in a file Hw5.pdf as part of the ZIP file you submit. Next I would like you to write two Java programs to experiment with using Sockets (we described how to do this toward the start of the semester). The first program is called AnalogClockServer.java. When run from the command line, it binds to port 40,000 and starts listening for requests. When a connection is made to port 40000, this server announces:

Welcome to the anolog clock server

This is followed by a newline. The second program I want you to write is called AnalogClockClient.java. It should be run from the command line using a command like:

java AnalogClockClient ip_address

where ip_address in the above is the ip_address of a AnalogClockServer. This client checks for the server message above. If it is not found it aborts with a reasonable message. Otherwise, it sends either the command:

time forward

followed by a newline or

time backward

followed by a newline. The server then sends three tabbed separated java floating point literals followed by a newline. These numbers represent the angle of the hour, minute, and seconds hands of an analog clock in radians calculated using the server's current time. If the command was "time forward", these three numbers are for a usual clock; the "time backward" gives the angles according to a clock whose dial is arranged backwards such as Reverse Clock. After you have implemented these two programs. Do some experiments where you are connecting using local host versus connecting via LAN. Look at how many connections per seconds your server can handle and write up you experimental results. Put the write-up of your results in the Hw5.pdf file. Include your code in the ZIP file.

For the last part of the homework I want you to do experiment on using a firewall together with your client server programs you created above. With the server runnning confirm that port 40000 is bound to using netstat -a, lsof -i, and nmap. Then using a such a firewall (ipfw on a mac, iptables or ipchains on a linux system, or using the GUI on Windows 7), do experiments by adding rules to block incoming, outbound, TCP, UDP, IP traffic to that port. Try different possibilities, not each of these at the same time. Check that the firewall is working by trying to run your client from another machine to that port. Then try to use nmap on the client. See what is happening on the server using netstat, lsof. Write these tests up as well in Hw5.pdf. (Make sure to list all your teammates and their IDs, this is the last homework, so it might be harder to come see me if there is a problem).

Point Breakdown

Book problesm, 1pt each graded (0, 0.5 partially complete/correct, 1 complete and correct) 6pts
Client and Server programs work as described (1pt each) 2pts
Client and Server speed experiments and write-up 1pts
Client and Server firewall experiments and write-up 1pts
Total10pts